Skip to content

Conversation

@stheid
Copy link

@stheid stheid commented Feb 12, 2024

In this case, (for example a degenerated probability distribution of 0 for all datapoints) the "abm" variant crashes during predict, because the logistic regression is called with the wrong amount of parameters

if self.map_[0] == 0:
x = x[:, 1].reshape(-1, 1)
elif self.map_[1] == 0:
x = x[:, 0].reshape(-1, 1)
return self.lr_.predict_proba(x)[:, 1]

This happens because the logistic regressions coefficients get 0 for such a degenerated case, and the lines above are executed accidentally.
De-aliasing the accidental 0 case with a None variable solves that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant